<template>
  <div id="app">
    <router-view />
    <div class="m-button-group-wrap">
      <el-button :disabled="current === 'Home'" type="text" icon="el-icon-edit"
        @click="handleJump('Home')">编辑模式</el-button>
      <el-button :disabled="current === 'Preview'" type="text" icon="el-icon-view"
        @click="handleJump('Preview')">预览模式</el-button>
      <el-button :disabled="current === 'HighLight'" type="text" icon="el-icon-star-on"
        @click="handleJump('HighLight')">高亮模式</el-button>
      <el-button :disabled="current === 'Xml'" type="text" icon="el-icon-copy-document"
        @click="handleJump('Xml')">XML数据</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Ref, ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()

const current: Ref<string> = ref('Home')

const handleJump = (name: string) => {
  current.value = name
  router.push({
    name
  })
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}

.m-button-group-wrap {
  width: 100%;
  position: fixed;
  left: 100px;
  bottom: 0;
  z-index: 9999;
}
</style>
